﻿using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.File.Models;

namespace MiniFox.Platform.File.Providers
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister]
    public interface IFolderProvider
    {
        /// <summary>
        /// 检查指定是否已存在
        /// </summary>
        /// <param name="group"></param>
        /// <param name="path"></param>
        bool PathExists(string group, string path);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        IEnumerable<FolderObject> GetAllFolders(string group, string path);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        IEnumerable<FolderObject> GetFolders(string group, string path);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="superId"></param>
        /// <returns></returns>
        IEnumerable<FolderObject> GetFolders(string superId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="path"></param>
        /// <param name="folderName"></param>
        /// <returns></returns>
        bool Rename(string group, string path, string folderName);
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="group"></param>
        ///// <param name="newFolderId"></param>
        ///// <param name="folderId"></param>
        ///// <param name="superPath"></param>
        ///// <returns></returns>
        //bool Copy(string group, string newFolderId, string folderId, string superPath);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="folderId"></param>
        /// <param name="superPath"></param>
        /// <returns></returns>
        bool Move(string group, string folderId, string superPath);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="folderId"></param>
        /// <param name="folderName"></param>
        /// <param name="path"></param>
        /// <param name="superId"></param>
        /// <returns></returns>
        bool Create(string group, string folderId, string folderName, string path, string superId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="superPath"></param>
        /// <returns></returns>
        bool Remove(string group, string superPath);
        /// <summary>
        /// 通过路径获到目录对象
        /// </summary>
        /// <param name="group"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        FolderObject GetFolder(string group, string path);
        /// <summary>
        /// 通过ID获到目录对象
        /// </summary>
        /// <param name="folderId"></param>
        /// <returns></returns>
        FolderObject GetFolder(string folderId);
        /// <summary>
        /// 通过目录ID获取目录下所有文件，包含子目录的所有文件
        /// </summary>
        /// <param name="folderId"></param>
        /// <returns></returns>
        IEnumerable<FileData> GetFiles(string folderId);
        /// <summary>
        /// 通过路径获取目录下所有文件，包含子目录的所有文件
        /// </summary>
        /// <param name="group"></param>
        /// <param name="superPath"></param>
        /// <returns></returns>
        IEnumerable<FileData> GetFiles(string group, string superPath);
    }
}